//
//  Contants.h
//  MHO
//
//  Created by papo on 2/17/14.
//  Copyright (c) 2014 maihoang. All rights reserved.
//

#import <Foundation/Foundation.h>


// Server url
#define kServerUrl  @"http://api.mho.vn/services/"
#define kServerUrl2 @"http://mobile.mho.vn/services/"

#define kServerKey  @"mho123190456$@!"

// Services Url
#define kServiceGameHot @"game"
#define kServiceGameFormat  @"Game?IdCategoryGame=%d&IdSystem=%d&IdGroup=%d&isHot=%d&isNews=%d&isMostView=%d&pageIndex=%d&pageSize=%d&key=%@"
#define kServiceGameDetail  @"game?gameid=%d&key=%@"
#define kServiceGameTop @"game?IdSystem=%d&IdGroup=%d&Count=%d&key=%@"
#define kServiceGameSearch  @"searchgame?IdSystem=%d&q=%@&p=%d&s=%d&key=%@"
#define kServiceNewsHot @"news"
#define kServiceNewsFormat    @"news?gameid=%d&pageindex=%d&pagesize=%d"
#define kServiceUserLogin   @"account?type=login"
#define kServiceUserRegister    @"account?type=register"
#define kServiceUserChangePass  @"account?type=changepass"
#define kServiceUserGetInfo     @"account?type=getinfo"
#define kServiceGetIpWan    @"IpWanTongBu"

#define kServiceId  @"2"
#define kServiceToken @"757c7aa7-2c95-4f5f-910c-54c862f1b271"


#define kPlatformIos        2
#define kPlatformAndroid    1
#define kGroupApp   2
#define kGroupGame  1


// Account Model
#define kAccountServiceId   @"serviceid"
#define kAccountServiceKey   @"servicekey"
#define kAccountEmail   @"email"
#define kAccountPassword   @"pwd"

#define kIsAuthen @"IsAuthen"
#define kAccountModelEmail  @"AccountEmail"
#define kAccountModelId     @"AccountId"
#define kAccountPublicName  @"PublicName"
#define kAccountRequestToken    @"RequestToken"
//#define kAccountRequestToken    @


// Application Model
#define kAppModelId     @"Id"
#define kAppModelName   @"Title"
#define kAppModelDesc   @"Des"
#define kAppModelDetail @"Detail"
#define kAppModeImagePath   @"Picture"
#define kAppModelLogoPath   @"LogoPath"
#define kAppModelPlatformId   @"GamePlatformId"
#define kAppModelPlatformName   @"GamePlatformName"
#define kAppModelUrlHomePage   @"UrlHomePage"
#define kAppModelPublisherId    @"PublisherId"
#define kAppModelPublisherName  @"PublisherName"
#define kAppModelTotalVote      @"Rate"
#define kAppModelTotalPoint     @"TotalPoint"
#define kAppModelTotalComment   @"TotalComment"
#define kApppModelTotalDownload @"Download"
#define kAppModelSize   @"Size"
#define kAppModelFile   @"File"
#define kAppModelPictureAlbum   @"PictureAlbum"
#define kAppModelView   @"View"
#define kAppModelVersion    @"Version"
#define kAppModelRate   @"Rate"
#define kAppModelLike   @"Like"



// News Model
#define kNewsModelId    @"ID"
#define kNewsModelTitle @"Title"
#define kNewsModelLead  @"Lead"
#define kNewsModelContent   @"Content"
#define kNewsModeImagePath  @"ImagePath"
#define kNewsModelSmallImagePath    @"SmallImagePath"
#define kNewsModelPublishDate       @"PublishDate"
#define kNewsModelUrlDetail         @"UrlDetail"

#define kFileBtnHuman   @"btn_human.png"
#define kFileBtnDownloadIcon    @"icon_download.png"
#define kFileBtnSearchIcon  @"icon_search.png"
#define kFileBtnBack        @"btn_back.png"

// IpWan
#define kIpWanId    @"Id"
#define kIpWanAddress @"IpWans"
#define kIpWanStatus    @"Status"
#define kIpWanDes   @"Mota"

@interface ServiceResult : NSObject
@property (nonatomic, assign) BOOL success;
@property (nonatomic, strong) NSString* message;

+ (ServiceResult*)result:(BOOL)succes message:(NSString*)message;

@end

@interface Contants : NSObject

+ (NSString*)urlForKey:(NSString*)key;
+ (NSString*)gameUrlForKey:(NSString*)key;
+ (NSString*)gameUrlWithGenre:(int)genre platform:(int)platform publisher:(int)publisher hot:(int)hot news:(int)news mostView:(int)mostView pageIndex:(int)index pageSize:(int)size;
+ (NSString*)gameUrlWithCategory:(int)category idSystem:(int)idSystem idGroup:(int)idGroup isHot:(int)isHot isNew:(int)isNew mostView:(int)mostView pageIndex:(int)index pageSize:(int)size key:(NSString*)key;
+ (NSURL*)getImageUrl:(NSString*)url width:(int)width height:(int)height;

+ (NSURL*)getAppPictureAlbumUrl:(NSString*)url;
@end
